import { request } from '@/apis';
import { addPrefix } from '@/utils/helper';
import type { Leader, Product, TechPromotion, GreenProductCertificate } from './types';

const prefixUrl = '/ep-query';

const Api = {
  technologyPromotion: '/getTechnologyPromotion',
  technologyFieldScreen: '/getTechnologyFieldScreen',
  leaderList: '/v1/energy/getLeaderList',
  productTypeScreen: '/screen/getProductTypeScreen',
  getEnergyProduct: '/getEnergyProduct',
  getGreenProductCertificate: '/getGreenProductCertificate',
  certificateCategory: '/screen/greenProductCertificate/category',
  greenProductTagEffective: '/screen/greenProductTagEffective',
  greenCertificationDepartment :'/screen/greenCertificationDepartment'
};

addPrefix(Api, prefixUrl);

export * from './types';

/** 国家成熟适用节水技术推广列表页 */
export const getTechnologyPromotion = (params: TechPromotion) => request.get({ url: Api.technologyPromotion, params });
/** 获取技术领域筛选项 */
export const getTechnologyFieldScreen = () => request.get({ url: Api.technologyFieldScreen });

/** 能效领跑者企业列表页 */
export const getLeaderList = (params: Leader) => request.get({ url: Api.leaderList, params });

/** 能效之星 */
export const getProductTypeScreen = () => request.get({ url: Api.productTypeScreen });
export const getEnergyProduct = (params: Product) => request.get({ url: Api.getEnergyProduct, params });

/** 节能节水环保认证企业 */
// export const getLeaderList = (params: TechPromotion) => request.get({ url: Api.leaderList, params });

/** 绿色产品认证 */
export const getGreenProductCertificate = (params: GreenProductCertificate) => request.get({ url: Api.getGreenProductCertificate, params });
/** 产品类别 筛选项 */
export const getCertificateCategory = () => request.get({ url: Api.certificateCategory });
/** 证书状态 筛选项 */
export const getGreenProductTagEffective = () => request.get({ url: Api.greenProductTagEffective });

/** 认定级别 */
export const getGreenCertificationDepartment = (params) => request.get({ url: Api.greenCertificationDepartment , params });
